// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2018-2023.
 * Description: irq: merge high-precision timer can reduce interrupts and context switches
 * Author: langfei
 * Create: 2023-12-25
 */

#include <linux/acpi.h>

#include "clocksource_high_precision.h"

unsigned long clocksource_period_divisor(unsigned long evt, u32 arch_timer_rate)
{
	unsigned long tmp = evt;
	int divisor;

	divisor = *this_cpu_ptr(&period_divisor);
	if (divisor != 0)
		tmp = arch_timer_rate / MSEC_PER_SEC / divisor;
	return tmp;
}
